﻿@model PhoneBilling.Models.PaymentNextModel
@{
    ViewBag.Title = "收款";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
}
<script type="text/javascript">
    function check() {
        var total = 0;
        $(".account").each(function () {
            if ($(this).attr("checked") == "checked") {
                total += Number($(this).attr("amount"));
            }
        });
        $("#total").text(total);
    }
    function beforeSubmit() {
        var str = "";
        $(".account").each(function () {
            if ($(this).attr("checked") == "checked") {
                if (str == "")
                    str += $(this).attr("id");
                else
                    str += "!" + $(this).attr("id");
            }
        });
        $("#SelectItem").attr("value", str);
    }
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#btnConfirm").ligerButton(
        {
            click: function () {
                beforeSubmit();
                $('form').submit();
            }
        });
    });
    
</script>
@using (Html.BeginForm())
{
    @Html.HiddenFor(m => m.SelectItem, new { id = "SelectItem" });
    <div>
        <h3 class="tlt">总金额：<span id="total">@Model.总金额</span></h3>
        @{
             var grid = new WebGrid(source: Model.AccountList, canPage:false);
        }
        @grid.GetHtml(
            alternatingRowStyle: "bg",
            columns: grid.Columns
            (
                  
                  grid.Column("部门", "部门"),
                  grid.Column("分组", "分组"),
                  grid.Column("分机号码", "分机号码"),
                  grid.Column("用户名", "用户名"),
                  grid.Column("月", "月"),
                  grid.Column("月租费", "月租费"),
                  grid.Column("功能费", "功能费"),
                  grid.Column("通话费", "通话费"),
                  grid.Column("话单总次数", "通话次数"),
                  grid.Column("话单总金额", "话单总金额")
            )
        )
        <p class="submit">
            @Html.CheckBoxFor(m => m.按月出账单) 按月出账单
            <input type="button" id="btnConfirm" value="确定" />
            @*<input type="submit" value="确定" class="input-submit" onclick="beforeSubmit()" />*@
        </p>
    </div>
}
